Documentation > CMS Template API Library > Input > ShowDropDown(String,String,String,String,List[String],Int32,Boolean,String,String,Boolean)

ShowDropDown

Shows a drop down menu selector control.

public System.Void ShowDropDown(String,String,String,String,List[String],Int32,Boolean,String,String,Boolean)

Parameters

NameDescriptionType
label The label of the field when displayed. System.String
fieldName The field name where the value will be stored. System.String
textList The text list. A comma-separated list of strings to display in the drop down. Use the other version if a comma is in the list. System.String
valueList The value list. A comma-separated list of strings to store when values are selected from drop down. Use the other version if a comma is in the list. System.String
defaultValue Optional: defaults to null. The list of default values that will appear selected when nothing has been selected. The size of this list can only be greater than 1 if and only if the optional parameter multiple is set to true. List<String>
size Optional: Controls the width of the dropdown. Defaults to 250. Values need to be between 158 and 450. System.Int32
multiple Optional: defaults to false. Setting this optional parameter to true will allow multiple selections from the drop down menu. System.Boolean
helpMessage Optional: help message System.String
popupMessage Optional: The popup help message. System.String
alwaysSend Optional: If true, the value of the field will always be sent from the frontend to the backend regardless of whether its state has changed. System.Boolean

Code Example

C#

Sample:
// The users will see Zero, One, and Two, but 0,1,2 will be stored as the value
Input.ShowDropDown("Nested Drop Down", "nested_drop", "Zero,One,Two", "0,1,2");

//The users will see English, French, Japanese, and Korean, but en, fr, jp, kr as the value
Input.ShowDropDown("Language Settings", "language_setting", "English,French,Japanese,Korean", "en,fr,jp,kr",  Util.MakeList("en"), 4, true);

Connect with Crownpeak